package nxu.it.entity;

/**
 * @author yangliu
 * @project jfinal-app-1
 * @sid 12020243892
 * @date 2022/10/8 - 10:25
 */

import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.format.TextStyle;
import java.util.Locale;

/**
 *   设置返回类型形如
 *   {year: 2021, month: 4, day: 14, hour: 9, minute: 15, weekday: Wednesday}
 */
public class TodayJson {
//    创建时间 2022-10-08 10:31:12
    LocalDateTime time=LocalDateTime.now();
    private int year=time.getYear();
    private int month=time.getMonthValue();
    private int day=time.getDayOfMonth();
    private int hour=time.getHour();
    private int minute=time.getMinute();
//    这里尝试输出中文版的日期，如果输出英文版，在getDisplayName函数修改类型就行
    private String weekend= time.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINA);

    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    public int getMinute() {
        return minute;
    }

    public void setMinute(int minute) {
        this.minute = minute;
    }

    public String getWeekend() {
        return weekend;
    }

    public void setWeekend(DayOfWeek weekend) {
        this.weekend = String.valueOf(weekend);
    }
}
